package com.stations.controller;

import cn.hutool.http.HttpResponse;
import com.github.pagehelper.PageInfo;
import com.stations.common.aop.annotation.Log;
import com.stations.common.aop.enums.BusinessType;
import com.stations.common.constant.ControllerConstant;
import com.stations.common.web.base.BaseController;
import com.stations.common.web.domain.request.PageDomain;
import com.stations.common.web.domain.response.Result;
import com.stations.common.web.domain.response.module.ResultTable;
import com.stations.domain.TStation;
import com.stations.domain.TTransmitter;
import com.stations.domain.TTransmitterTask;
import com.stations.domain.dtree.DTree;
import com.stations.domain.dtree.DTreeResponse;
import com.stations.domain.dtree.Status;
import com.stations.service.TrasmiterTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.List;

/**
 * Describe: 发射机任务控制器
 * Author: jintao
 * CreateTime: 2019/10/23
 */
@RestController
@Api(tags = {"发射机任务管理"})
@RequestMapping(ControllerConstant.API_SYSTEM_PREFIX + "task")
public class TransmiterTaskController extends BaseController {

    /**
     * Describe: 基础路径
     */
    private static String MODULE_PATH = "system/task/";

    @Resource
    private TrasmiterTaskService sysTrasmiterTaskService;



    /**
     * 分页查询发射机列表
     */
    @ResponseBody
    @GetMapping("/data")
    @PreAuthorize("hasPermission('/system/transmittertask/data','sys:transmittertask:data')")
    public ResultTable list(@ModelAttribute TTransmitterTask tTransmitterTask, PageDomain pageDomain) {
        PageInfo<TTransmitterTask> pageInfo = sysTrasmiterTaskService.selectTTransmitterTaskPage(tTransmitterTask, pageDomain);
        return pageTable(pageInfo.getList(), pageInfo.getTotal());
    }
}
